module.exports = {
  prefix: '/bmap/',
  get: {
    'geoCode': {
      des: {
        name: 'getGeoCode',
        content: '获取地理位置',
        params: [
          {
            query: 'lat',
            type: 'Float,纬度'
          }, {
            query: 'lng',
            type: 'Float,经度'
          },
        ]
      },
      method: function* () {
        var self = this
        var query = self.request.query;
        var _url = `http://api.map.baidu.com/geocoder/v2/?ak=yyvKdot9D7eZZvKsYliWchrg&location=${query.lat||38.76623},${query.lng||116.43213}&output=json&pois=1`
        var res = yield request({ url: _url, method: 'GET' });
        self.body = JSON.parse(res);
      }
    }
  }
}
